Skip to content

Conversation

@sbueringer
Copy link
Member

@sbueringer sbueringer commented Nov 14, 2025

What this PR does / why we need it:
Removes patchHelper to avoid unnecessary resource usage and gives callers a choice if the resourceVersion on the passed-in object should be updated.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-area PR is missing an area label size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 14, 2025
@sbueringer sbueringer added the area/misc Issues or PRs not related to any other area label Nov 14, 2025
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/needs-area PR is missing an area label label Nov 14, 2025
@sbueringer sbueringer force-pushed the pr-improve-hook-utils branch from a5f7631 to 55a23d5 Compare November 14, 2025 15:46
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 14, 2025
@sbueringer sbueringer changed the title [WIP] 🌱 Improve mark hook utils 🌱 Improve mark hook utils Nov 14, 2025
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 14, 2025
@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-main-gke

@sbueringer
Copy link
Member Author

/hold

I'll take another look myself on Monday, but PR is ready for review

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 14, 2025
@sbueringer
Copy link
Member Author

/hold cancel

All good

/assign @fabriziopandini

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 17, 2025
Comment on lines +158 to +166
if !updateResourceVersionOnObject {
obj = obj.DeepCopyObject().(client.Object)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if !updateResourceVersionOnObject {
obj = obj.DeepCopyObject().(client.Object)
}
// In some cases it is preferred to not update resourceVersion in the input object,
// because this could lead to conflict errors e.g. when patching at the end of a reconcile loop.
if !updateResourceVersionOnObject {
obj = obj.DeepCopyObject().(client.Object)
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same in MarkAsDone/MarkAsOkToDelete

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added

@sbueringer sbueringer force-pushed the pr-improve-hook-utils branch from 55a23d5 to 1c2aeaa Compare November 17, 2025 09:23
Copy link
Member

@fabriziopandini fabriziopandini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 17, 2025
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 805520d85d305d7e856787e5c4191c7d3c05c3e7

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fabriziopandini

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 17, 2025
@k8s-ci-robot k8s-ci-robot merged commit d25a869 into kubernetes-sigs:main Nov 17, 2025
18 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.12 milestone Nov 17, 2025
@sbueringer sbueringer deleted the pr-improve-hook-utils branch November 17, 2025 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. area/misc Issues or PRs not related to any other area cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants